<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../../css/font.css">
    <link rel="stylesheet" href="../../css/xadmin.css">
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../js/xadmin.js"></script>
    <style>
        /*.layui-card-header{*/
        /*    color: #FFFFFF;*/
        /*}*/
        /*.layui-card-body{*/
        /*    color: #FFFFFF;*/
        /*}*/
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm6 layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote" style="border-left: 5px solid #1e9fff; font-size: 14px; margin-top: 10px">欢迎管理员：
                        <span class="x-red" id="user-name"></span>！   当前时间：<span id="time"></span>
                    </blockquote>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4" >
            <div class="layui-card" >
                <div class="layui-card-header"style="background-color: #01AAED;color: #FFFFFF"><i class="iconfont">&#xe6b8;</i> 用户数
                </div>
                <div class="layui-card-body" style="background-color: #01AAED;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="user_num">0</p>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header" style="background-color: #FF5722;color: #FFFFFF"><i class="iconfont">&#xe696;</i> 竞赛数
                </div>
                <div class="layui-card-body " style="background-color: #FF5722;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="competition_num">0</p>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header" style="background-color: #FFB800;color: #FFFFFF"><i class="iconfont">&#xe829;</i> 未开始
                </div>
                <div class="layui-card-body " style="background-color: #FFB800;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="unstart_num">0</p>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header" style="background-color: #5FB878;color: #FFFFFF"><i class="iconfont">&#xe735;</i> A榜
                </div>
                <div class="layui-card-body " style="background-color: #5FB878;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="A_num">0</p>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header" style="background-color: #009688;color: #FFFFFF"><i class="iconfont">&#xe736;</i> B榜
                </div>
                <div class="layui-card-body " style="background-color: #009688;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="B_num">0</p>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header" style="background-color: #2F4056;color: #FFFFFF"><i class="iconfont">&#xe6b1;</i> 已结束
                </div>
                <div class="layui-card-body " style="background-color: #2F4056;color: #FFFFFF">
                    <p class="layuiadmin-big-font" style="font-size: 18px; line-height: 48px" id="end_num">0</p>
                </div>
            </div>
        </div>
<!--        <div class="layui-col-md12">-->
<!--            <div class="layui-card">-->
<!--                <div class="layui-card-header">系统信息</div>-->
<!--                <div class="layui-card-body ">-->
<!--                    <table class="layui-table">-->
<!--                        <tbody>-->
<!--                        <tr>-->
<!--                            <th>xxx版本</th>-->
<!--                            <td>1.0.180420</td></tr>-->
<!--                        <tr>-->
<!--                            <th>服务器地址</th>-->
<!--                            <td>x.xuebingsi.com</td></tr>-->
<!--                        <tr>-->
<!--                            <th>操作系统</th>-->
<!--                            <td>WINNT</td></tr>-->
<!--                        <tr>-->
<!--                            <th>运行环境</th>-->
<!--                            <td>Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9</td></tr>-->
<!--                        <tr>-->
<!--                            <th>PHP版本</th>-->
<!--                            <td>5.6.27</td></tr>-->
<!--                        <tr>-->
<!--                            <th>PHP运行方式</th>-->
<!--                            <td>cgi-fcgi</td></tr>-->
<!--                        <tr>-->
<!--                            <th>MYSQL版本</th>-->
<!--                            <td>5.5.53</td></tr>-->
<!--                        <tr>-->
<!--                            <th>ThinkPHP</th>-->
<!--                            <td>5.0.18</td></tr>-->
<!--                        <tr>-->
<!--                            <th>上传附件限制</th>-->
<!--                            <td>2M</td></tr>-->
<!--                        <tr>-->
<!--                            <th>执行时间限制</th>-->
<!--                            <td>30s</td></tr>-->
<!--                        <tr>-->
<!--                            <th>剩余空间</th>-->
<!--                            <td>86015.2M</td></tr>-->
<!--                        </tbody>-->
<!--                    </table>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
    </div>
</div>

</body>

<script src="../../lib/jquery.min.js"></script>
<script src="../../js/const.js"></script>
<script src="../../js/util.js"></script>
<script>
    function checkLoginState() {
        userInfo = util.getLocalStorage("user");
        console.log(userInfo);
        if(userInfo != null && typeof(userInfo) != 'undefined'){
            $("#user-name").html(userInfo.userName);
        }
    }
    checkLoginState();
    function addPreZero(num){
        return ('0'+num).slice(-2);
    }
    function time(){
        var vWeek,vWeek_s,vDay;
        vWeek = ["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
        var date =  new Date();
        year = date.getFullYear();
        month = date.getMonth() + 1;
        day = date.getDate();
        hours = date.getHours();
        minutes = date.getMinutes();
        seconds = date.getSeconds();
        vDay = date.getDay();
        hours = addPreZero(hours);
        minutes = addPreZero(minutes);
        seconds = addPreZero(seconds);
        document.getElementById("time").innerHTML = year + "年" + month + "月" + day + "日" + "\t" + vWeek[vDay] + "\t" + hours + ":" + minutes +":" + seconds  ;

    }
    time();
    setInterval("time()",1000);
    util.sendGET("/statistics_info",function (response) {
        $("#user_num").html(response.data.user_num);
        $("#competition_num").html(response.data.competition_num);
        $("#unstart_num").html(response.data.unstart_num);
        $("#A_num").html(response.data.A_num);
        $("#B_num").html(response.data.B_num);
        $("#end_num").html(response.data.end_num);
    },function (response) {
        
    })
</script>
</html>